<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Lesson Project: App/app_main.c Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Lesson Project<span id="projectnumber">&#160;Beta V1.0</span>
   </div>
   <div id="projectbrief">Course Learning Template Engineering</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_b1617d756d2224e91d37255e84e89ba2.html">App</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="headertitle"><div class="title">app_main.c</div></div>
</div><!--header-->
<div class="contents">
<a href="app__main_8c.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="preprocessor">#include &quot;<a class="code" href="app__main_8h.html">app_main.h</a>&quot;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"><a class="line" href="app__main_8c.html#a0638823491d35f41a8f9c464fa5fcf87">   11</a></span><span class="keyword">static</span> TaskHandle_t <a class="code hl_variable" href="app__main_8c.html#a0638823491d35f41a8f9c464fa5fcf87">LED_TaskHandle</a> = NULL;  </div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="app__main_8c.html#aa71051d6b8fcb5d4af58be905e7f3e21">start_task</a>(<span class="keywordtype">void</span> * PvParameters);</div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="app__main_8c.html#a5f7388bf69ce33f58b5f0197067ac3dd">led_task</a>(<span class="keywordtype">void</span> * PvParameters);</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span> </div>
<div class="foldopen" id="foldopen00018" data-start="{" data-end="}">
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"><a class="line" href="app__main_8c.html#a630544a7f0a2cc40d8a7fefab7e2fe70">   18</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="app__main_8c.html#a630544a7f0a2cc40d8a7fefab7e2fe70">app_main</a>(<span class="keywordtype">void</span>)</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span>{</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span>    uint16_t w25qxx_id = 0;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span>    w25qxx_id = <a class="code hl_function" href="w25qxx_8c.html#a621f3e3670e9f64bb3d320f96e55bcfd">w25qxx_read_id</a>();</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span>    <span class="keywordflow">if</span>(w25qxx_id == 0xef16)</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span>        __NOP();</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span>        </div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span>    xTaskCreate(<a class="code hl_function" href="app__main_8c.html#aa71051d6b8fcb5d4af58be905e7f3e21">start_task</a>,<span class="stringliteral">&quot;start_task&quot;</span>,<a class="code hl_define" href="app__main_8h.html#a1fda16f523e1a48c4ba103a20f9d230b">START_TASK_SIZE</a>,NULL,<a class="code hl_define" href="app__main_8h.html#ad8e9db053ca0bd99fd7c8b8604a211f8">START_TASK_PRIO</a>,NULL);</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span>    vTaskStartScheduler();</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span>    <span class="keywordflow">while</span>(1)</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span>    {</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span> </div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span>    }</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span>}</div>
</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno">   32</span> </div>
<div class="foldopen" id="foldopen00039" data-start="{" data-end="}">
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="app__main_8c.html#aa71051d6b8fcb5d4af58be905e7f3e21">   39</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="app__main_8c.html#aa71051d6b8fcb5d4af58be905e7f3e21">start_task</a>(<span class="keywordtype">void</span> * PvParameters)</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span>{</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span>    (void )PvParameters;</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span>    portENTER_CRITICAL();</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span>    xTaskCreate(<a class="code hl_function" href="app__main_8c.html#a5f7388bf69ce33f58b5f0197067ac3dd">led_task</a>,<span class="stringliteral">&quot;led_task&quot;</span>,<a class="code hl_define" href="app__main_8h.html#a43a84ac0bcbe3c4507e5ae6d3fd25d16">LED_TASK_SIZE</a>,NULL,<a class="code hl_define" href="app__main_8h.html#a967b5e009e5342a8095fdcd1ae4a2788">LED_TASK_PRIO</a>,&amp;<a class="code hl_variable" href="app__main_8c.html#a0638823491d35f41a8f9c464fa5fcf87">LED_TaskHandle</a>);</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span>    portEXIT_CRITICAL();</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span>    vTaskDelete(NULL);</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span>}</div>
</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span> </div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span> </div>
<div class="foldopen" id="foldopen00055" data-start="{" data-end="}">
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"><a class="line" href="app__main_8c.html#a5f7388bf69ce33f58b5f0197067ac3dd">   55</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="app__main_8c.html#a5f7388bf69ce33f58b5f0197067ac3dd">led_task</a>(<span class="keywordtype">void</span> * PvParameters)</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span>{</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span>    (void )PvParameters;</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span> </div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span>    <span class="keyword">static</span> uint8_t led_status = 0;</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span> </div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span>    <span class="keywordflow">while</span> (1)</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span>    {</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span>        vTaskDelay(pdMS_TO_TICKS(1000));</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span>        HAL_GPIO_WritePin(GPIOC,GPIO_PIN_13,led_status);</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno">   65</span>        <span class="keywordflow">if</span>(led_status)</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno">   66</span>            led_status = 0;</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno">   67</span>        <span class="keywordflow">else</span></div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno">   68</span>            led_status = 1;</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno">   69</span>    }</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span>    </div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span>}</div>
</div>
<div class="ttc" id="aapp__main_8c_html_a0638823491d35f41a8f9c464fa5fcf87"><div class="ttname"><a href="app__main_8c.html#a0638823491d35f41a8f9c464fa5fcf87">LED_TaskHandle</a></div><div class="ttdeci">static TaskHandle_t LED_TaskHandle</div><div class="ttdoc">LED Task Handler.</div><div class="ttdef"><b>Definition</b> <a href="#l00011">app_main.c:11</a></div></div>
<div class="ttc" id="aapp__main_8c_html_a5f7388bf69ce33f58b5f0197067ac3dd"><div class="ttname"><a href="app__main_8c.html#a5f7388bf69ce33f58b5f0197067ac3dd">led_task</a></div><div class="ttdeci">static void led_task(void *PvParameters)</div><div class="ttdoc">LED Task.</div><div class="ttdef"><b>Definition</b> <a href="#l00055">app_main.c:55</a></div></div>
<div class="ttc" id="aapp__main_8c_html_a630544a7f0a2cc40d8a7fefab7e2fe70"><div class="ttname"><a href="app__main_8c.html#a630544a7f0a2cc40d8a7fefab7e2fe70">app_main</a></div><div class="ttdeci">void app_main(void)</div><div class="ttdoc">User Function Enter.</div><div class="ttdef"><b>Definition</b> <a href="#l00018">app_main.c:18</a></div></div>
<div class="ttc" id="aapp__main_8c_html_aa71051d6b8fcb5d4af58be905e7f3e21"><div class="ttname"><a href="app__main_8c.html#aa71051d6b8fcb5d4af58be905e7f3e21">start_task</a></div><div class="ttdeci">static void start_task(void *PvParameters)</div><div class="ttdoc">Start Task.</div><div class="ttdef"><b>Definition</b> <a href="#l00039">app_main.c:39</a></div></div>
<div class="ttc" id="aapp__main_8h_html"><div class="ttname"><a href="app__main_8h.html">app_main.h</a></div></div>
<div class="ttc" id="aapp__main_8h_html_a1fda16f523e1a48c4ba103a20f9d230b"><div class="ttname"><a href="app__main_8h.html#a1fda16f523e1a48c4ba103a20f9d230b">START_TASK_SIZE</a></div><div class="ttdeci">#define START_TASK_SIZE</div><div class="ttdoc">Start Task Stack Deep.</div><div class="ttdef"><b>Definition</b> <a href="app__main_8h_source.html#l00036">app_main.h:36</a></div></div>
<div class="ttc" id="aapp__main_8h_html_a43a84ac0bcbe3c4507e5ae6d3fd25d16"><div class="ttname"><a href="app__main_8h.html#a43a84ac0bcbe3c4507e5ae6d3fd25d16">LED_TASK_SIZE</a></div><div class="ttdeci">#define LED_TASK_SIZE</div><div class="ttdoc">LED Task Stack Deep.</div><div class="ttdef"><b>Definition</b> <a href="app__main_8h_source.html#l00039">app_main.h:39</a></div></div>
<div class="ttc" id="aapp__main_8h_html_a967b5e009e5342a8095fdcd1ae4a2788"><div class="ttname"><a href="app__main_8h.html#a967b5e009e5342a8095fdcd1ae4a2788">LED_TASK_PRIO</a></div><div class="ttdeci">#define LED_TASK_PRIO</div><div class="ttdoc">LED Task Priority.</div><div class="ttdef"><b>Definition</b> <a href="app__main_8h_source.html#l00038">app_main.h:38</a></div></div>
<div class="ttc" id="aapp__main_8h_html_ad8e9db053ca0bd99fd7c8b8604a211f8"><div class="ttname"><a href="app__main_8h.html#ad8e9db053ca0bd99fd7c8b8604a211f8">START_TASK_PRIO</a></div><div class="ttdeci">#define START_TASK_PRIO</div><div class="ttdoc">Start Task Priority.</div><div class="ttdef"><b>Definition</b> <a href="app__main_8h_source.html#l00035">app_main.h:35</a></div></div>
<div class="ttc" id="aw25qxx_8c_html_a621f3e3670e9f64bb3d320f96e55bcfd"><div class="ttname"><a href="w25qxx_8c.html#a621f3e3670e9f64bb3d320f96e55bcfd">w25qxx_read_id</a></div><div class="ttdeci">uint16_t w25qxx_read_id(void)</div><div class="ttdoc">Get w25qxx's id.</div><div class="ttdef"><b>Definition</b> <a href="w25qxx_8c_source.html#l00035">w25qxx.c:35</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
